﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Decode.Umb.Pixlr
{
	public class pixlrDataType : umbraco.cms.businesslogic.datatype.BaseDataType, umbraco.interfaces.IDataType
	{
		private umbraco.interfaces.IDataEditor _Editor;
		private umbraco.interfaces.IData _baseData;
		private pixlrPrevalueEditor _prevalueeditor;


		public override umbraco.interfaces.IDataEditor DataEditor
		{
			get
			{
				if (_Editor == null)
					_Editor = new pixlrDataEditor(Data, ((pixlrPrevalueEditor)PrevalueEditor).GetEditorTypeSetting);
				return _Editor;
			}
		}

		public override umbraco.interfaces.IData Data
		{
			get
			{
				if (_baseData == null)
					_baseData = new umbraco.cms.businesslogic.datatype.DefaultData(this);

				return _baseData;
			}
		}

		public override Guid Id
		{
			get { return new Guid("3128AD7F-EF40-4a62-81B7-11BF8992217B"); }
		}

		public override string DataTypeName
		{
			get { return "Pixlr"; }
		}

		public override umbraco.interfaces.IDataPrevalue PrevalueEditor
		{
			get
			{
				if (_prevalueeditor == null)
					_prevalueeditor = new pixlrPrevalueEditor(this);
				return _prevalueeditor;
			}
		}
	}
}